package ar.com.temporis.framework.context;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * 
 * @author matias.sulik
 *
 */
public class FrameworkContext implements ApplicationContextAware {

	private static ApplicationContext APPLICATION_CONTEXT;

	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		APPLICATION_CONTEXT = applicationContext;
	}

	public static Object getBean(String id) {
		return APPLICATION_CONTEXT.getBean(id);
	}

	public static ApplicationContext getApplicationContext() {
		return APPLICATION_CONTEXT;
	}
}
